package com.simpleframe.views.chart.attribution;

/**
 * 图表提示
 * @author Administrator
 *
 */
public class ChartTooltip {
	
	/**
	 * 边框的颜色
	 */
	private String colour;
	
	/**
	 * 提示框宽度
	 */
	private int stroke;
	
	/**
	 * 背景的颜色
	 */
	private String background;

	public ChartTooltip(String colour, int stroke, String background) {
		this.colour = colour;
		this.stroke = stroke;
		this.background = background;
	}
	
	public ChartTooltip(){

	}
	
	/**
	 * 将提示框的属性以字符串形式返回
	 * @return
	 */
	public String getTooltipString(){
		StringBuffer sb = new StringBuffer();
		sb.append(ChartTool.addQuotes("tooltip")+":\n");
		sb.append(ChartTool.addHT("{\n"));
		sb.append("\t");
		sb.append(ChartTool.addQuotes("colour") + ":");
		sb.append(ChartTool.addQuotes(colour) + ",\n");

		sb.append("\t");
		sb.append(ChartTool.addQuotes("stroke") + ":");
		sb.append(ChartTool.checkField(""+stroke) + ",\n");

		sb.append("\t");
		sb.append(ChartTool.addQuotes("background") + ":");
		sb.append(ChartTool.addQuotes(background) + "\n");
	
		sb.append(ChartTool.addHT("}\n"));
		return sb.toString();
	}
	
	public void DefaultSetting(){
		colour = new String("#000000");
		stroke = 1;
		background = "#ffffff";
	}
	
	/**
	 * 以下为属性的get和set方法
	 * @return
	 */
	
	public String getColour() {
		return colour;
	}

	public void setColour(String colour) {
		this.colour = colour;
	}

	public int getStroke() {
		return stroke;
	}

	public void setStroke(int stroke) {
		this.stroke = stroke;
	}

	public String getBackground() {
		return background;
	}

	public void setBackground(String background) {
		this.background = background;
	}
	
	
}
